package cn.bdqn.pn.reposity.commodity;

import cn.bdqn.pn.pojo.commodity.Commodity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface CommodityReposity extends JpaRepository<Commodity,Integer> , JpaSpecificationExecutor<Commodity> {
    List<Commodity> findAllByStatus(Integer status);

    Commodity findAllByCommodityName(String CommodityName);    //根据商品名获取id

    /**
     * 根据输入内容模糊查商品名返回集合
     * @return
     */
    public List<Commodity> findCommodityByCommodityNameLike(String commodityName);


}
